package se.perp.c4.model;

import se.perp.c4.model.Actor.EActor;
import static se.perp.c4.model.Actor.Side.*;

class ActorFactory {

    public static Actor create(EActor who) {
        Actor a = new Actor();
        a.who = who;

        switch (who) {
            case FRODO:
                a.name = "Frodo";
                a.portraitName = a.name;
                a.description = "When attacked, may retreat sideways.";
                a.side = LIGHT;
                a.attackValue = 1;
                break;
            case MERRY:
                a.name = "Merry";
                a.portraitName = a.name;
                a.description = "Instantly defeats the Witch King.";
                a.side = LIGHT;
                a.attackValue = 2;
                break;
            case PIPPIN:
                a.name = "Pippin";
                a.portraitName = a.name;
                a.description = "When attacking, may retreat backwards.";
                a.side = LIGHT;
                a.attackValue = 1;
                break;
            case SAM:
                a.name = "Sam";
                a.portraitName = a.name;
                a.description = "When with Frodo, strength is 5 and may take Frodo's place in battle.";
                a.side = LIGHT;
                a.attackValue = 2;
                break;
            case BOROMIR:
                a.name = "Boromir";
                a.portraitName = a.name;
                a.description = "Both Boromir and the enemy character are instantly defeated.";
                a.side = LIGHT;
                a.attackValue = 0;
                break;
            case ARAGORN:
                a.name = "Aragorn";
                a.portraitName = a.name;
                a.description = "May attack any adjacent region.";
                a.side = LIGHT;
                a.attackValue = 4;
                break;
            case LEGOLAS:
                a.name = "Legolas";
                a.portraitName = a.name;
                a.description = "Instantly defeats the Flying Nazgûl.";
                a.side = LIGHT;
                a.attackValue = 3;
                break;
            case GIMLI:
                a.name = "Gimli";
                a.portraitName = a.name;
                a.description = "Instantly defeats the Orcs.";
                a.side = LIGHT;
                a.attackValue = 3;
                break;
            case GANDALF:
                a.name = "Gandalf";
                a.portraitName = a.name;
                a.description = "The dark player must play their card first.";
                a.side = LIGHT;
                a.attackValue = 5;
                break;

            case CAVETROLL:
                a.name = "Cave Troll";
                a.portraitName = a.name;
                a.description = "The dark player's card has no value or effect.";
                a.side = DARK;
                a.attackValue = 9;
                break;
            case WARG:
                a.name = "Warg";
                a.portraitName = a.name;
                a.description = "Enemy character's text is ignored.";
                a.side = DARK;
                a.attackValue = 2;
                break;
            case ORCS:
                a.name = "Orcs";
                a.portraitName = a.name;
                a.description = "When attacking, instantly defeats the first character.";
                a.side = DARK;
                a.attackValue = 2;
                break;
            case SARUMAN:
                a.name = "Saruman";
                a.portraitName = a.name;
                a.description = "May decide no cards are played.";
                a.side = DARK;
                a.attackValue = 4;
                break;
            case SHELOB:
                a.name = "Shelob";
                a.portraitName = a.name;
                a.description = "After Shelob defeats an enemy character, she is immediately returned to Gondor.";
                a.side = DARK;
                a.attackValue = 5;
                break;
            case BALROG:
                a.name = "Balrog";
                a.portraitName = a.name;
                a.description = "When in Moria, instantly defeats any character using the tunnel.";
                a.side = DARK;
                a.attackValue = 5;
                break;
            case B_RIDERS:
                a.name = "Black Riders";
                a.portraitName = "B. Riders";
                a.description = "May move forward any number of regions to attack.";
                a.side = DARK;
                a.attackValue = 3;
                break;
            case F_NAZGUL:
                a.name = "Flying Nazgûl";
                a.portraitName = "F. Nazgûl";
                a.description = "May attack any single enemy character anywhere on the board.";
                a.side = DARK;
                a.attackValue = 3;
                break;
            case WITCHKING:
                a.name = "Witch King";
                a.portraitName = a.name;
                a.description = "May attack sideways.";
                a.side = DARK;
                a.attackValue = 5;
                break;
            default:
                throw new Error("This should not be.");
        }
        return a;
    }
}
